import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkYueDanOrderVO, SkYueDanOrderForm, SkYueDanOrderQuery } from '@/api/app/SkYueDanOrder/types';

/**
 * 查询约单订单列表
 * @param query
 * @returns {*}
 */

export const listSkYueDanOrder = (query?: SkYueDanOrderQuery): AxiosPromise<SkYueDanOrderVO[]> => {
  return request({
    url: '/app/SkYueDanOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询约单订单详细
 * @param id
 */
export const getSkYueDanOrder = (id: string | number): AxiosPromise<SkYueDanOrderVO> => {
  return request({
    url: '/app/SkYueDanOrder/' + id,
    method: 'get'
  });
};

/**
 * 查询约单订单详细
 * @param id
 */
export const getNewInfo = (id: string | number): AxiosPromise<SkYueDanOrderVO> => {
  return request({
    url: '/app/SkYueDanOrder/getInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增约单订单
 * @param data
 */
export const addSkYueDanOrder = (data: SkYueDanOrderForm) => {
  return request({
    url: '/app/SkYueDanOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改约单订单
 * @param data
 */
export const updateSkYueDanOrder = (data: SkYueDanOrderForm) => {
  return request({
    url: '/app/SkYueDanOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除约单订单
 * @param id
 */
export const delSkYueDanOrder = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkYueDanOrder/' + id,
    method: 'delete'
  });
};

//getUserSexSumList,getDaRenSexSumList
export const getUserSexSumList = (): AxiosPromise<Map<any, any>> => {
  return request({
    url: '/app/SkYueDanOrder/getUserSexSumList',
    method: 'get'
  });
};

export const getDaRenSexSumList = (): AxiosPromise<Map<any, any>> => {
  return request({
    url: '/app/SkYueDanOrder/getDaRenSexSumList',
    method: 'get'
  });
};

